//
//  CollectionTableViewCell.m
//  HimalayaMusic
//
//  Created by dllo on 16/1/18.
//  Copyright © 2016年 WXCLegendary. All rights reserved.
//

#import "CollectionTableViewCell.h"

@implementation CollectionTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.mainImage = [[UIImageView alloc] init];
        self.titleLabel = [[UILabel alloc] init];
        [self addSubview:self.mainImage];
        [self addSubview:self.titleLabel];
        
    }
    return self;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    self.mainImage.frame = CGRectMake(5, 5, self.height - 10, self.height - 10);
    self.titleLabel.frame = CGRectMake(self.mainImage.right + 5, self.mainImage.top, self.width - self.mainImage.right - 10, 40);
}

- (void)setAlbumList:(AlbumList *)albumList {
    if (_albumList != albumList) {
        _albumList = albumList;
    }
    [self.mainImage sd_setImageWithURL:[NSURL URLWithString:self.albumList.image]];
    self.titleLabel.text = self.albumList.title;
    
}


- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
